<script>
import { withStore } from '@/utils/withStore'
export default withStore({
  template: `
    <el-select v-bind="$attrs" v-on="$listeners" :loading="loading" style="width: 100%">
      <template slot="empty">
        <div v-if="error">
          数据加载失败, 请重试
          <br />
          <el-button type="text" @click="load">重试</el-button>
        </div>
      </template>
      <el-option
        v-for="(item, index) in data"
        :key="index"
        :label="item.label"
        :value="item.value"
      ></el-option>
    </el-select>
  `
})
</script>
